﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace IDT.Wpf.Watcher
{
    [ValueConversion(typeof(double), typeof(double))]
    public class AlbumImageWidthConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            double width = (double) value;
            return width/3;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    [ValueConversion(typeof(double), typeof(Thickness))]
    public class AlbumImageMarginConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            double width = (double)value;
            return new Thickness(width / 25, width / 60, width / 25, width / 60);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}